﻿@model IEnumerable<Fish.Models.WallPosts>

@{
    ViewBag.Title = "Index";
}

<h2>Wall Posts</h2>

<p>
    @Html.ActionLink("New Post", "Create")
</p>


<div id="mcs_container">
    <div class="customScrollBox">
        <div class="container">
            <div class="content">
                @foreach (var item in Model)
                {

                    <div class="activity">                        
                        @Html.Label("Name: ")
                        @Html.DisplayFor(modelItem => item.User.Username)
                        <br />                                                
                        @Html.Label("Post: ")
                        @Html.DisplayFor(modelItem => item.Text)
                        <br />
                        @if ((item.User.ID + "").Equals(Session["userID"].ToString()))
                        {
                            @Html.ActionLink("Edit |", "Edit", new { id = item.ID })
                        }
                        @if ((item.User.ID + "").Equals(Session["userID"].ToString()))
                        {
                            @Html.ActionLink("Delete", "Delete", new { id = item.ID })
                        }
                    </div>

                }
                <div style="clear: both"></div>

            </div>
        </div>
        <div class="dragger_container" style="float:right">
            <div class="dragger"></div>
        </div>
    </div>
</div>


<div>
    @Html.ActionLink("Back to Event", "currentEvent", "EventInfo")
</div>
@section Scripts {

    <script src="@Url.Content("/Scripts/jquery.mCustomScrollbar.js")" type="text/javascript"></script>
    <script src="@Url.Content("/Scripts/jquery-ui.js")" type="text/javascript"></script>
    <script src="@Url.Content("/Scripts/jquery.mousewheel.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("/Scripts/jquery.easing.1.3.js")" type="text/javascript"></script>
    <script type="text/javascript">qm_create(0, false, 0, 500, 'all', false, false, false, false);</script>
    <script>
        $("#activity").addClass("qmactive");
    </script>
    <noscript>
        <style type="text/css">
            #mcs_container .customScrollBox {
                overflow: auto;
            }

            #mcs_container .dragger_container {
                display: none;
            }
        </style>
    </noscript>

    <script>
        $(window).load(function () {
            mCustomScrollbars();
        });

        function mCustomScrollbars() {
            /*
            malihu custom scrollbar function parameters:
            1) scroll type (values: "vertical" or "horizontal")
            2) scroll easing amount (0 for no easing)
            3) scroll easing type
            4) extra bottom scrolling space for vertical scroll type only (minimum value: 1)
            5) scrollbar height/width adjustment (values: "auto" or "fixed")
            6) mouse-wheel support (values: "yes" or "no")
            7) scrolling via buttons support (values: "yes" or "no")
            8) buttons scrolling speed (values: 1-20, 1 being the slowest)
            */
            $("#mcs_container").mCustomScrollbar("vertical", 300, "easeOutCirc", 1.05, "auto", "yes", "yes", 15);
        }

        /* function to fix the -10000 pixel limit of jquery.animate */
        $.fx.prototype.cur = function () {
            if (this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null)) {
                return this.elem[this.prop];
            }
            var r = parseFloat(jQuery.css(this.elem, this.prop));
            return typeof r == 'undefined' ? 0 : r;
        }
    </script>
    <script src="/Scripts/scrollbar/jquery.mCustomScrollbar.js"></script>
}

